#pragma once

class Interface_SplashScreen_Effect_Rose;
class Interface_SplashScreen_Effect_Cloud;
class Interface_SplashScreen_Effect_Petals;

class SplashScreen : public System_Plugin_Interface
{
	std::string				mAbout;
	std::string				mVersion;
	std::string				mType;

	bool					mbInitialized;

	SmartPtr<HGE_Impl>				m_pHGESys;
	SmartPtr<hgeTTF :: FontManager>	m_pFontManager;
	SmartPtr<hgeResourceManager>	m_pResource;

	std::string				mDirectory;

protected:
	struct StarData
	{
		float x, y;
		float scale;
		float alpha;
		StarData() : x(0), y(0), scale(1), alpha(255){}
	};	
	/* Image Data */
	SmartPtr <hgeSprite> MoonImg, StarImg;
	SmartPtr <hgeSprite> GlowImg;
	SmartPtr <hgeSprite> SkyImg;
	
	/* Graphics */
	std::deque <StarData> mGraphic_StarData;
	float m_fStellarUpdateTime;

	SmartPtr <Interface_SplashScreen_Effect_Rose>	mRoseBed;
	SmartPtr <Interface_SplashScreen_Effect_Cloud>	mClouds;
	SmartPtr <Interface_SplashScreen_Effect_Petals> mPetals;
public:
	SplashScreen(std::string Dir);
	~SplashScreen();
	/* DLL only */
	inline HGE_Impl *			HGESYSTEM() { return m_pHGESys.get(); }
	inline hgeResourceManager * RESOURCE()	{ return m_pResource.get(); }

	/* STD functions */
	virtual bool				Initialize(HGE_Impl * HGESystem, hgeTTF :: FontManager * FontManager, System_Audio * AudioSystem);
	virtual bool				Deinitialize();
	virtual const bool			Initialized() const;
	virtual const std::string & About();
	// Return values from below in CAPS
	virtual const std::string & GetVersion();
	virtual const std::string & Type();	
	virtual const std::string	ChangePhase();	
	virtual void				Update(const float & Interval);
	virtual void				Render();	
};

extern SmartPtr <SplashScreen> g_pSplashScreen;